package com.rongzhe.house.ui.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;

import com.rongzhe.house.R;
import com.rongzhe.house.entity.HouseEntrustTo;
import com.rongzhe.house.internet.DataListener;
import com.rongzhe.house.manager.HouseManager;
import com.rongzhe.house.presenter.HouseEntrustPresenter;
import com.rongzhe.house.ui.view.EditTextWithRightCleanButton;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by huang on 2017/12/13.
 */

public class HouseEntrustActivity extends BaseActivity<HouseEntrustPresenter> {
    @BindView(R.id.edit_real_name)
    EditTextWithRightCleanButton editRealName;
    @BindView(R.id.edit_phone_number)
    EditTextWithRightCleanButton editPhoneNumber;
    @BindView(R.id.edit_city)
    EditTextWithRightCleanButton editCity;
    @BindView(R.id.edit_cell_name)
    EditTextWithRightCleanButton editCellName;

    @Override
    protected HouseEntrustPresenter createPresenter() {
        return new HouseEntrustPresenter(this);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_house_entrust);
        ButterKnife.bind(this);
    }

    @OnClick(R.id.btn_ok)
    public void onSubmitClick() {
        HouseEntrustTo houseEntrust = new HouseEntrustTo(editRealName.getText().toString(),
                editPhoneNumber.getText().toString(),
                editCity.getText().toString(),
                editCellName.getText().toString());
        mPresenter.doEntrust(houseEntrust);
    }

    @Override
    protected String getActionTitle() {
        return getString(R.string.entrust_only);
    }
}
